package com.zwkj.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zwkj.common.R;
import com.zwkj.domain.WUserT;
import com.zwkj.pojo.vo.FileVo;
import com.zwkj.service.IPreviewWpsService;
import com.zwkj.service.IWUserTService;
import com.zwkj.util.RequestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/")
public class UserWpsController {
    @Autowired
    private IWUserTService userTService;


    /**
     * 获取文件信息
     *
     * @param userIds
     * @return
     */
    @GetMapping("v3/3rd/users")
    private R<?> getFileById(@RequestParam("user_ids") List<String> userIds) {
        String typeStr = RequestUtils.getUserQuery(RequestUtils.getCurrentRequest(), "type");
        List<WUserT> list =new ArrayList<>();
        //预览 模拟数据
        if (typeStr == null || typeStr.equals("") || typeStr.equals("1")) {
            list = userTService.list(new QueryWrapper<WUserT>().in("id", 1));
        }
        //数据编辑
        if (typeStr != null && !typeStr.equals("") && typeStr.equals("2")) {
             list = userTService.list(new QueryWrapper<WUserT>().in("id", userIds));
        }

        return R.ok(list);
    }


}
